package com.atguigu.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @USER: dayu
 * @DATE: 2020/4/3
 * @DESCRIPTION:
 * @RefreshScope ：动态监听并拉取修改的配置 这个注解非常重要！！
 */
@RestController
@RefreshScope
public class PaymentNacosController {
    //读取Nacos配置中心文件的数据
    @Value("${config.info}")
    private String configInfo;

    @GetMapping("/payment/configInfo")
    public String configInfo() {
        return configInfo;
    }
}
